require(['./config'], () => {
    require(['header', 'utils', 'footer'], (utils) =>{
        class Regist {
            constructor () {
             this.DataZc()
            }
            DataZc () {
                $('#zhuce').on('click', function () {
                    var name=$('#name_2').val()
                    var pwd=$('#pwd_2').val()
                    $.post('/cake/dist/api/register.php', {name, pwd}, resp => {
                         if(resp.code === 200) {
                            $.cookie('name', name, {path: '/' }) 
                            alert(resp.body.msg + '，即将跳转首页')
                            location.href = '/index.html'
                         }else {
                            alert(resp.body.msg)
                         }
                    },'json')
                })
            }
        }
        new Regist()
    })
})
